/**
 * @file HttpAgent.h
 * @brief
 *
 *
 * @author Wang haoyu
 * @email 136046355@qq.com
 */
#ifndef __HTTPAGENT_H__
#define __HTTPAGENT_H__

#include <string>

#include "common/comm/SocketAddress.h"
#include "common/comm/TCPAgent.h"

#include "common/http/HttpResponse.h"

class HttpAgent : public TCPAgent
{
  public:
    HttpResponse *response_;

  public:
    HttpAgent();
    HttpAgent(const SocketAddress &addr);
    ~HttpAgent();

    int init();
    int connectAfter(bool bConnect);
    int sendPackage(std::string &data);
    void readBack(InReq &req);
    int recvData();

    string getHost();
};

#endif // __HTTPAGENT_H__
